import React, { FC } from 'react';
import { connect } from 'dva';
import { LoadingModule } from '@/components';
import { Tabs, Select } from 'antd';

import PageGoodsSync from './components/pageGoodsSync';

import pageConfig from './config/pageConfig';
const { namespace, pageName } = pageConfig;

interface PageProps {}

const Page: FC<PageProps> = (props: any) => {
  const {
    [namespace]: { isEnumLoading },
  } = props;
  return (
    <>
      <div className="pageTitle">{pageName}</div>
      <div className="pageBox">
        <div className="contentPrimary">
          {isEnumLoading ? <LoadingModule /> : <PageGoodsSync {...props} />}
        </div>
      </div>
    </>
  );
};

// 配置model
const mapStateToProps = (props: any) => {
  return {
    [namespace]: props[namespace],
  };
};

// 处理状态
const mapDispatchToProps = (dispatch: any) => {
  return {
    actions: {},
  };
};

export default connect(mapStateToProps, mapDispatchToProps)(Page);
